package com.leen.aspect.permiss;


import com.leen.aspect.annon.RequiredPermission;

/**创建验证权限工厂
 * @author nick
 */
public class AuthorizationFactory {

    /**
     * 简单工厂
     * @param requiredPermission
     * @return
     */
    public static Authorization createAuthorization(RequiredPermission requiredPermission){
        Authorization  authorization=null;
        if(requiredPermission.logical() ==Logical.AND){
            authorization=new AuthorizationAnd(requiredPermission);
        }else{
            authorization=new AuthorizationOr(requiredPermission);
        }
        return  authorization;
    }
}
